USE [NGroup_VTL_DB]
GO

/****** Object:  StoredProcedure [dbo].[GetNewsDetail]    Script Date: 9/16/2014 8:42:45 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		Bui Thanh Nam
-- Create date: 20140916
-- Description:	Get News's Detail by unique string
-- =============================================
CREATE PROCEDURE [dbo].[GetNewsDetailForEdit]
	@UniqueString		NVARCHAR(500)
AS
BEGIN

	SET NOCOUNT ON;

	SELECT 
			   [dbo].[News].[Title_En],
			   [dbo].[News].[Title]
			  ,[dbo].[News].[MetaContent_En]
			  ,[dbo].[News].[MetaContent]
			  ,[dbo].[News].[BriefContent_En]
			  ,[dbo].[News].[BriefContent]
			  ,[dbo].[News].[FullContent_En]
			  ,[dbo].[News].[FullContent]
			  ,[dbo].[News].[ImageSmallURL_En]
			  ,[dbo].[News].[ImageSmallURL]
			  ,[dbo].[News].[ID]
			  ,[dbo].[News].[TypeID]
			  ,[dbo].[News].[UniqueString]			 
			  ,[dbo].[News].[IsActive]
			  ,[dbo].[News].[CreatedAt]
			  ,[dbo].[News].[CreatedBy]
			  ,[dbo].[News].[LastUpdatedAt]
			  ,[dbo].[News].[LastUpdatedBy]
		FROM [dbo].[News] WITH (NOLOCK)INNER JOIN [dbo].[GenericTypes] WITH (NOLOCK)
			ON [dbo].[News].[TypeID] = [dbo].[GenericTypes].[ID]
		WHERE [dbo].[News].[UniqueString] = @UniqueString
		AND [dbo].[News].[IsActive] <> 0
		AND [dbo].[GenericTypes].[IsActive] <> 0
END


GO


